package controller.servlet.product;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.Product;
import controller.dao.Dao_Product;

public class deleteProduct extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int codigo = Integer.parseInt(request.getParameter("cod"));
		Dao_Product daoe = new Dao_Product();
		Product p = daoe.list(codigo);
		p.setActive(0);
		daoe.delete(p);
		response.sendRedirect("/ShoppingCart.Com_V6/admin/product.ja");
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

	}

}
